<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>

<script type="text/javascript">
$(document).ready(function() {

	$(".actionPlay").click(function() {
		var uri = $(this).attr('href'); 
		if (uri==='') {
			alert('ไม่มีข้อมูลเพลง');
		}
		else {
			ISS.Popup.Windows.Show_Modal("View Song", uri, null, 340, 400, null);		
		}
		return false;
	});
	

}); 
</script>

<?php
echo html::Stylesheet(
array
(
			'media/css/gene_block.css',
),
array
(
			'screen',
)
);
?>

<div id="mainCont">
<h3>รายการเพลง</h3>
<table>
	<tr>
		<th>ชื่อรายการเพลง</th>
		<th>รายละเอียด</th>
		<th>คำสั่ง</th>
	</tr>
	<?php
	$i = 0;
	foreach ($playlists as $item):
	$i++;
	echo (($i % 2)==0) ? '<tr class="geneListDark">' : '<tr class="geneListLight">';
	?>
	<td><?php echo html::specialchars($item['title']); ?></td>
	<td><?php echo html::specialchars($item['description']); ?></td>
		<td>
		<a class='actionEdit'
			href="<?php echo url::base(); ?>/index.php/playlist/edit/<?php echo $item['id']; ?>"><img
			alt="แก้ไข" src="<?php echo url::base();?>/media/images/edit.png"
			border="0" />
		</a>
		<a class='actionPlay' href="<?php echo url::base() . 'index.php/top_order/show/show_playlist/'. $item['id'] ; ?>">
			<img class="imgPlay" alt="ฟัง" src="<?php echo url::base();?>/media/images/play.gif"/></a>
		</td>

	</tr>
	<?php endforeach ?>
</table>

	<?//php echo $pagination ?></div>
